<template>
  <div id="myCharts" ref="myCharts" class="myCharts" style="width:100%; height:500px"></div>
</template>

<script>
export default {
  props: {
    seriesData: {
      type:  Object
    },
    extraOption: {
      type: Object,
      default: () => ({})
    }
  },
  data() {
    return {
        myCharts:''
    };
  },
  watch: {
    seriesData: {
      deep: true,
      handler(val) { 
        this.myCharts.setOption(val);
      }
    }
  },
  mounted() {
    const echarts = require('echarts');
    this.myCharts = echarts.init(this.$refs.myCharts);
    this.myCharts.setOption(this.seriesData);
  },
  beforeDestroy() {
  },
  methods: {
    
  }
};
</script>

<style lang="less" scoped>
.chart {
  width: 100%;
  height: 100%;
}
</style>